#ifndef NETUTIL_HPP
#define NETUTIL_HPP

#include <boost/cstdint.hpp>

namespace kieper {
    namespace netutil {
        int createUdpSock();
        void bindSock(int sock, int port);
        void setNonBlocking(int sock);
        void setBlocking(int sock);
        void setBroadcast(int sock);

        void setAsNbo16(char* buffer, unsigned int index, uint16_t val);
        void setAsNbo32(char* buffer, unsigned int index, uint32_t val);

        uint32_t getFromNbo32(const char* buffer, unsigned int index);
        uint16_t getFromNbo16(const char* buffer, unsigned int index);
    }
}

#endif
